<script>
export default {
  name: "MySchool",
  data() {
    return {
      name: "武汉大学",
      address: "武汉"
    }
  },
  mounted() {
    this.$bus.$on("getStudentName", (getStudentName) => {
      console.log("我是School组件 我收到了来自student组件传递过来的学生姓名:" + getStudentName)
    })
  }
}
</script>

<template>
  <div class="school">
    <h2>学校名称:{{ name }}</h2>
    <h2>学校地址:{{ address }}</h2>
  </div>
</template>
<style scoped>
.school {
  background-color: pink;
  padding: 5px;
  margin-top: 30px;
}
</style>